<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body style="border: 0px; margin: 0px; padding: 0px;width: 100%;height: 100%">
<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
	<table style="width:100%;">
        <tr>
            <td style="width:100%;">
                <a class="mini-button" iconCls="icon-remove" onclick="remove()">删除</a>  
            </td>
        </tr>
    </table>
</div>
<div class="mini-fit" >
<div id="datagrid1" class="mini-datagrid" multiSelect="true" idField="id" pageSize="20" url="message_view.do" style="width:100%;height:100%;">
	<div property="columns">
		<div type="indexcolumn"></div>
		<div type="checkcolumn" ></div>
		<div field="content" width="70%" headerAlign="center" align="center">内容</div>
		<div field="createTime" width="30%" dataType="date" dateFormat="yyyy-MM-dd HH:mm:ss" headerAlign="center" align="center">发送时间</div>
	</div>
</div>
</div>

<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");
grid.load();

//批量删除
function remove(){
var rows = grid.getSelecteds();
if (rows.length > 0) {
	if (confirm("确定删除选中记录？")) {
		var arr = new Array();
		$.each(rows,function(i,v){
			arr.push(v.id);
		});
		var rids = arr.join("-");
		grid.loading("操作中，请稍后......");
		$.ajax({
			url: "message_delete.do?id=" + rids,
			success: function (text) {
					mini.showMessageBox({
						title: "提示",
						showModal:false,
						iconCls: "mini-messagebox-info",
						message: "删除成功！",
						timeout: 3000,
						x: 'right',
						y: 'bottom'
					});
				grid.reload();
			}
		});
	}
} else {
	mini.alert("请选中一条记录");
}
}
</script>
</body>
</html>